function getCurrentFormattedTime () {
  const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  const now = new Date()

  const year = now.getFullYear()
  const month = (now.getMonth() + 1).toString().padStart(2, '0')
  const day = now.getDate().toString().padStart(2, '0')
  const weekday = weekdays[now.getDay()]
  const hours = now.getHours().toString().padStart(2, '0')
  const minutes = now.getMinutes().toString().padStart(2, '0')
  const seconds = now.getSeconds().toString().padStart(2, '0')

  const formattedTime = `${year}年${month}月${day}日  ${weekday}  ${hours}:${minutes}:${seconds}`
  return formattedTime
}

const footer = document.querySelector('.layui-footer')
const currentTime = getCurrentFormattedTime()
footer.innerHTML = '<i class="layui-icon layui-icon-time" ></i >  ' + currentTime

setInterval(function () {
  const currentTime = getCurrentFormattedTime()
  footer.innerHTML = '<i class="layui-icon layui-icon-time" ></i >  ' + currentTime
}, 1000)


